<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>11-innerHTML属性</title>

    <style type="text/css">
        #div11 {
            width:200px;
            height:150px;
            border:2px dashed red;
        }
    </style>
</head>
<body>
<input type="button" value="点击" onclick="doClick();"/>
<span id="sid">哈哈呵呵</span>

<div id="div11">

</div>
<script type="text/javascript">
    //获取span标签
    var span1 = document.getElementById("sid");
    //alert(span1.innerHTML);

    //向div里面设置内容 <h1>AAAAA</h1>
    //获取到div
    var div11 = document.getElementById("div11");
    //设置内容
    div11.innerHTML = "<h1>AAAAA</h1>";

//    //向div里面添加一个表格
//   var tab = "<table border='1'><tr><td>aaaaaa</td></tr><tr><td>bbbbbb</td></tr><tr><td>cccccc</td></tr></table>";
//    var tab = "<table>";
//    tab += "</table>";
//    //相当于 var tab = "<table></table>";
//    div11.innerHTML = tab;


    function  doClick() {


    }

</script>



</body>
</html>